package com.jyb.controller;

import java.util.List;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Record;
import com.jyb.model.MyOrder;
import com.jyb.vo.UserVo;

public class MyOrderController extends Controller{

	public void index(){
		
		UserVo userVo=(UserVo)getSession().getAttribute("user");
		if(userVo==null){
			redirect("/login");
		}else{
			List<Record> records=MyOrder.dao.getNewest(30, userVo.getId());
			
			setAttr("nav", "myOrder");
			setAttr("records", records);
			renderJsp("/views/myOrder/index.jsp");
		}
	}
	
}
